package com.zhengqing.design.action.memento._01;

/**
 * <p> 创建&存储状态 </p>
 *
 * @author zhengqingya
 * @description
 * @date 2022/12/22 11:21
 */
public class Originator {
    private String state;

    public void setState(String state) {
        this.state = state;
    }

    public String getState() {
        return this.state;
    }

    public Memento saveStateToMemento() {
        return new Memento(this.state);
    }

    public void getStateFromMemento(Memento Memento) {
        this.state = Memento.getState();
    }
}